package com.client.controller;


import com.client.common.R;
import com.client.pojo.FlowerOrder;
import com.client.service.FlowerOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 晚云
 * @since 2023-09-12
 */
@CrossOrigin
@RestController
@RequestMapping("/flower-order")
public class FlowerOrderController {

    @Autowired
    private FlowerOrderService flowerOrderService;

    /**
     * 查询用户的订单
     * @param userId
     * @return
     */
    @GetMapping("/init/{userId}")
    public R init(@PathVariable("userId") String userId){
        List<FlowerOrder> flowerOrders = flowerOrderService.order_select_List(userId);
        return R.success(flowerOrders);
    }
}

